#ifndef __PAM_PG_H_
#define __PAM_PG_H_

#define _GNU_SOURCE

#include <stdlib.h>
#include <unistd.h>
#include <syslog.h>
#include <string.h>
#include <sys/types.h>
#include <sys/cdefs.h>
#include <openssl/md5.h>
#include <security/pam_modules.h>
#include "pam_pg_options.h"

#define PAM_SM_AUTH
#define PAM_SM_ACCOUNT
#define PAM_SM_PASSWORD
#define PAM_SM_SESSION

#define PAM_MODULE_NAME		"pam-pg"
#define PASSWD_PROMPT		"Password: "
#define PASSWD_PROMPT_ACTUAL	"(Current) Password: "
#define PASSWD_PROMPT_NEW	"(New) Password: "
#define PASSWD_PROMPT_CONFIRM	"Retype (New) Password: "
#define PASSWD_DONT_MATCH	"As senhas nao conferem.\n"
#define PASSWD_SMALL		"A senha deve ter no minimo 8 caracteres.\n"
#define ACCOUNT_EXPIRED		"Conta expirada.\n"
#define ACCOUNT_INATIVE		"Conta inativa.\n"

#define SYSLOG(x...)   openlog("pam-pg", LOG_PID, LOG_AUTH); \
                       syslog(LOG_INFO, ##x);                \
                       closelog(); 

/* Options */
#define PAM_OPT_DEBUG                   0x01
#define PAM_OPT_NO_WARN                 0x02
#define PAM_OPT_USE_FIRST_PASS          0x04
#define PAM_OPT_TRY_FIRST_PASS          0x08
#define PAM_OPT_USE_MAPPED_PASS         0x10
#define PAM_OPT_ECHO_PASS               0x20
#define PAM_OPT_TRY_OLDAUTH             0x40
#define PAM_OPT_USE_OLDAUTH             0x80

int get_passwd(pam_handle_t *, char **, int , char *);

#endif
